package com.googlecode.xbeandatasource.common;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;


/**
 * @author Johny Huang
 *
 */
public class Employee {

	public static final String MALE="male";
	public static final String FEMALE="female";
	
	
	private String name;
	private String address;
	private List colleages;
	private Set jobTitle;
	private Map familyMember;
	private String gender;
	private Date birthday;
	

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public static final Employee newEmployee(String name) {
		return new Employee(name);
	}

	public Employee() {

	}

	public Employee(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public List getColleages() {
		return colleages;
	}

	public void setColleages(List colleages) {
		this.colleages = colleages;
	}

	public Employee addColleage(Employee emp) {
		if (this.colleages == null) {
			this.colleages = new ArrayList();
		}
		this.colleages.add(emp);
		return this;
	}

	public Set getJobTitle() {
		return jobTitle;
	}

	public void setJobTitle(Set jobTitle) {
		this.jobTitle = jobTitle;
	}

	public Employee addJobTitle(String jobTitle) {
		if (this.jobTitle == null) {
			this.jobTitle = new HashSet(5);
		}
		this.jobTitle.add(jobTitle);
		return this;
	}
	
	public Employee addFamilyMember(String relationShip,String memberName){
		if(this.familyMember==null){
			this.familyMember=new HashMap();
		}
		this.familyMember.put(relationShip, memberName);
		return this;
	}

	public Map getFamilyMember() {
		return familyMember;
	}

	public void setFamilyMember(Map familyMember) {
		this.familyMember = familyMember;
	}

	public String toString() {
		return name;
	}
}
